#insight {
  > div {
    display: grid;
    grid-template-columns: minmax(280px, 15vw);
    grid-template-rows: 60px;
    grid-template-areas: 'side head' 'side main';
    grid-gap: 0 $block-gap;
  }

  .crunching {
    margin: 3em 0 2em 0;
  }

  .loading {
    .insight__main {
      position: relative;
    }

    .spinner {
      @extend %abs-100, %flex-center;

      top: 0;
      left: 0;
      height: 550px;
      opacity: 0.7;

      svg {
        margin: auto;
        width: 80px;
        height: 80px;
      }
    }
  }

  .broken {
    display: flex;
    flex-flow: column;
    align-items: center;
    text-align: center;
    padding: 200px 0;
    width: 100%;
  }

  .broken i {
    font-size: 50px;
  }

  .chart {
    height: 550px;
  }

  .loading .chart {
    filter: blur(3px);
    opacity: 0.5;
  }

  .chart.empty {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-flow: column;
    font-size: 1.5em;
    opacity: 0.7;
  }

  .chart.empty i {
    margin-bottom: 30px;
    display: block;
    font-size: 200px;
    opacity: 0.5;
  }

  .left-side {
    grid-area: side;
  }

  header {
    @extend %box-radius-top;

    background: #333;
    color: #ddd;
    height: 100%;
    grid-area: head;

    h2 {
      font-size: 2em;
      line-height: 60px;
    }

    h2::before {
      font-size: 42px;
      vertical-align: top;
      line-height: 60px;
      margin: 0 10px;
    }

    > * {
      display: inline-block;
    }

    .ms-choice {
      background: #444;
      color: #ddd;
      border-color: #666;
    }
  }

  .insight__main {
    background: $c-bg-box;
    border: $border;
    border-top: 0;
    grid-area: main;
  }

  .axis-form {
    float: right;
  }

  .axis-form .by {
    padding: 0 20px;
  }

  .axis-form .ms-choice {
    padding: 30px 10px;
    border-width: 0 1px;
    border-radius: 0;
    transition: 0.15s;
  }

  .axis-form .ms-choice span {
    line-height: 60px;
    text-align: center;
  }

  .axis-form .ms-choice div {
    top: 18px;
  }

  .axis-form .ms-drop {
    color: $c-font;

    ul > li label input {
      display: none;
    }

    ul > li.selected label {
      background: $c-accent;
      color: $c-accent-over;
    }
  }

  .panel-tabs {
    @extend %flex-center-nowrap;

    justify-content: center;
    align-items: flex-end;
    border-bottom: 2px solid $c-border;

    .tab {
      @extend %roboto;

      flex: 1 1 auto;
      text-align: center;
      padding: 0.5em 0.2em;
      cursor: pointer;
      position: relative;
      color: $c-font-page;

      @include transition(color, 0.25s);

      min-width: 15%;

      &::after {
        content: '';
        background: fade-out($c-accent, 0.4);
        height: 2px;
        position: absolute;
        width: 96%;
        left: 2%;
        bottom: -2px;

        @include transition(all, 0.25s);

        transform: scale(0);
      }

      &.active,
      &:hover {
        &::after {
          transform: scale(1);
        }
      }

      &.active {
        color: $c-accent;
      }
    }
  }

  .presets {
    @extend %box-neat;

    a {
      color: $c-font;
      display: block;
      padding: 0.7em;

      @include transition;
    }

    a::before {
      opacity: 0.7;
      transition: opacity 0.13s;
    }

    a:hover {
      background: mix($c-accent, $c-bg-box, 20%);
    }

    a:hover::before {
      opacity: 1;
    }

    a.active {
      color: $c-accent;
    }
  }

  .clear {
    color: $c-bad;
    font-size: 0.9em;
    margin-bottom: 0.5em;
  }

  .filters {
    .box {
      border-bottom-width: 0;
    }

    .box:last-child {
      border-bottom-width: 1px;
    }

    .ms-parent {
      display: block;
    }

    .ms-choice {
      padding: 15px 10px;
      border-width: 0 0 1px 0;

      @include transition;
    }

    .ms-parent:last-child .ms-choice {
      border-bottom: 0;
    }

    .ms-parent.selected .ms-choice {
      $c-sel-ms-choice: fade-out($c-accent, 0.3);

      background: linear-gradient(
        to right,
        $c-sel-ms-choice 0px,
        $c-sel-ms-choice 5px,
        rgba(0, 0, 0, 0) 5px,
        rgba(0, 0, 0, 0) 100%
      );
    }

    .ms-parent:hover .ms-choice {
      background: mix($c-accent, $c-bg-box, 20%);
    }

    .ms-choice span {
      text-align: right;
      line-height: 30px;
      background: none;
    }

    .ms-choice div {
      top: 4px;
    }

    .ms-drop ul > li label input {
      margin-right: 5px;
      cursor: pointer;
    }

    .ms-drop {
      margin-left: 99%;
      top: 0;
      left: 0;
    }
  }

  .ms-parent,
  .ms-parent button {
    user-select: none;
  }

  .ms-choice:focus,
  .ms-parent input:focus {
    outline: 0;
  }

  .ms-drop {
    font-size: 0.9em;

    ul {
      padding: 0;
      overflow: auto;
    }

    ul > li label:not(.optgroup) {
      padding: 4px 8px;
      cursor: pointer;

      @include transition;

      text-indent: 1em;
    }

    ul > li label:not(.optgroup):hover {
      background: mix($c-accent, $c-bg-box, 20%);
    }

    ul > li label.optgroup {
      border-top: $border;
      margin-top: 5px;
      text-indent: 0;
      text-transform: uppercase;
      font-weight: normal;
      opacity: 0.6;
      padding: 6px 8px 2px 8px;
    }

    ul > li:first-child label.optgroup {
      margin-top: 0;
    }
  }

  .box {
    @extend %box-neat;

    .top {
      @extend %metal, %box-radius-top;

      padding: #{$block-gap / 2} $block-gap;
      font-weight: bold;
      border-bottom: $border;
    }

    .content {
      padding: $block-gap;
    }
  }

  .info {
    margin-bottom: $block-gap;

    p {
      margin: 0;
    }

    .insight-stale {
      padding: $block-gap;

      button {
        width: 100%;
      }
    }

    .share a {
      text-decoration: underline;
    }
  }

  .help.box {
    margin-top: 20px;
  }

  .help .dimension {
    margin-top: 10px;
  }

  .help h3 {
    margin: 0;
    font-weight: bold;
  }

  .help a {
    text-decoration: underline;
  }

  td.data {
    font-weight: bold;
  }

  .game-sample {
    margin: 2em 0 1em 0;
    border-top: $border;
    box-shadow: none;
  }

  .boards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 25%));

    a {
      @extend %box-radius;

      @include transition(background);

      color: $c-font;
      padding: 0.4em;

      span {
        box-shadow: none;
        background: none;
      }

      &:hover {
        background: mix($c-link, $c-bg-box, 20%);
      }
    }

    .vstext {
      @extend %flex-between-nowrap, %nowrap-hidden, %box-neat;

      background: $c-bg-box;
      padding: 0.3em 0.6em;

      &__pl,
      &__op {
        @extend %ellipsis;

        max-width: 45%;
      }

      &__pl {
        text-align: left;
      }

      &__op {
        text-align: right;
      }
    }
  }
}
